package com.zsck.zsgy.ui.main.fragment.home

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.zsck.zsgy.base.BaseViewModel
import com.zsck.zsgy.ui.main.bean.CityModel
import com.zsck.zsgy.ui.main.bean.HomeBean

class HomeViewModel :BaseViewModel() {

    private val repo by lazy { HomeRepo(viewModelScope, errorLiveData) }

    val homeModel = MutableLiveData<HomeBean>()
    val cityModel=MutableLiveData<List<CityModel>>()


    fun getCityByCityName(cityName:String){
        repo.getCityByCityName(cityName,cityModel)
    }

    fun getHomeData(cityId:String,cityName:String,latitude:String,longitude:String){
        repo.getHomeData(cityId, cityName, latitude, longitude, homeModel)
    }


}